﻿using System.IO;
using System.Xml;

namespace CommonUtils
{
    public class XHtmlDocument : XmlDocument
    {
        public XHtmlDocument() { }

        public XHtmlDocument(string xHtml)
        => LoadXml(xHtml);

        public static XHtmlDocument FromXHtml(string xHtml)
        => new XHtmlDocument(xHtml);

        public static XHtmlDocument FromFile(string path)
        {
            var xHtml = new XHtmlDocument();
            xHtml.Load(path);
            return xHtml;
        }

        public static XHtmlDocument FromStream(Stream stream)
        {
            var xHtml = new XHtmlDocument();
            xHtml.Load(stream);
            return xHtml;
        }
    }
}
